% addEdge adds an edge to a graph, args are (from,to,graph)
function newG = addEdge(fromVertex,toVertex,oldG,varargin)

[xmax ymax]=size(oldG);
newG = zeros(xmax,ymax);
for x=1:xmax
    for y=1:ymax
        newG(x,y) = oldG(x,y);       
    end;
end;

newG(fromVertex,toVertex) = 1;
newG(toVertex,fromVertex) = 1;